/**
 * Created with hong.rong
 * Date:2020/07/06
 */

import { useState, useEffect } from 'react'
import { getUploadConfig } from '@/services/common'

export default function useUploadConfig() {
  const [config, setConfig] = useState({})

  useEffect(() => {
    async function getConfig() {
      const { data = {} } = await getUploadConfig()
      if (data && data.code === 0) {
        setConfig(data.data || {})
      }
    }
    getConfig()
  }, [])

  return {
    config,
  }
}
